/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

/**
 * 订单申请/审核
 *  */
// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  // 审核列表
  'POST /RefundReview/RefundReviewList': (req: Request, res: Response) => {
    const { page = '', size, status } = req.body;
    return res.json({
      code: 0,
      data: Mock.mock({
        [`list|${size}`]: [
          {
            id: '@id',
            // 'kb_type|1': ['kdy', 'inn', 'wkd'],
            'kb_type|1': ['wkd'],
            user_id: 'user' + '@id',
            trans_desc: '@csentence',
            pic: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
            applicant: '@cname',
            trade_number: 'trade_number' + '@id',
            status,
            'money|1-100.1-10': 1,
            'real_money|1-100.1-10': 1,
            'pay_money|1-100.1-10': 1,
            create_time: '@time',
            update_at: '@time',
            reason: '@csentence(30, 31)',
            waybill_no: 'SF' + '@id()',
            // 'kb_name|1': ['快递员', '驿站', '微快递'],
            'kb_name|1': ['微快递'],
          },
        ],
        count: 100,
        page,
      }),
      msg: 'success',
    });
  },
  // 添加审核信息
  'POST /RefundReview/RefundReviewAdd': (req: Request, res: Response) => responseSuccess(req, res),
  // 删除列表审核
  'POST /RefundReview/RefundReviewDel': (req: Request & { body: { id: string } }, res: Response) =>
    responseSuccess(req, res),
  // 审核
  'POST /RefundReview/review': (
    req: Request & { body: { id: string; status: string; reason: string; money: string } },
    res: Response,
  ) => responseSuccess(req, res),
  // 获取资金流水信息
  'POST /RefundReview/getTradInfo': (
    req: Request & { body: { id: string; status: string; reason: string; money: string } },
    res: Response,
  ) => {
    return res.json({
      code: 0,
      data: Mock.mock({
        'kb_name|1': ['快递员', '驿站', '微快递'],
        'kb_type|1': ['kdy', 'inn', 'wkd'],
        user_id: 'user' + '@id',
        waybill_no: 'waybill_no' + '@id',
        'type|1': ['1', '2'],
        money: '123',
      }),
      msg: 'success',
    });
  },
  // 上传
  'POST /RefundReview/uploadImg': (req: Request, res: Response) => {
    const result = {
      code: 0,
      msg: 'success',
      data: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
    };
    return res.json(result);
  },
  // 获取实时余额
  'POST /RefundReview/getMoney': (req: Request, res: Response) => {
    const result = {
      code: 0,
      msg: 'success',
      data: {
        money: '123',
      },
    };
    return res.json(result);
  },
};
